<include file="__PUBLIC__/header"/>
<div class="page-container">
    <!--菜单-->
    <div class="cl pd-5 bg-1 bk-gray mt-10 mb-10">
        <span class="l">
            <a href="javascript:;" onclick="qz_layer_open('创建插件','{|U:'add'}')" class="btn btn-primary radius">
                <i class="iconfont icon-shouz"></i> 快速创建
            </a>
        </span>
        <span class="r" style="line-height:1.6em;margin-top:3px"><strong></strong></span>
    </div>
    <!--列表-->
    <table class="table table-border table-bordered table-bg mt-10 table-sort" id="table">
        <thead>
        <tr class="text-c">
            <th>名称</th>
            <th>标识</th>
            <th>描述</th>
            <th>状态</th>
            <th>作者</th>
            <th>版本</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <list from="$data" name="$qz">
            <tr class="text-c">
                <td>
                    {$qz.name}
                </td>
                <td>{$qz.title}</td>
                <td>{$qz.description}</td>
                <td>
                    <if value="$qz.status">
                        <span class="c-red">√</span>
                        <else/>
                        <span class="c-blue">×</span>
                    </if>
                </td>
                <td>{$qz.author}</td>
                <td>{$qz.version}</td>
                <td>
                    <a href="javascript:package('{$qz.name}')" class="label label-primary radius">打包</a>
                    <if value="$qz.install">
                        <if value="$qz.config">
                            <a href="{|U:'config',array('id'=>$qz['id'])}" class="label label-primary radius">设置</a>
                            <else/>
                            <span class="label label-default radius">设置</span>
                        </if>
                        <if value="$qz.status">
                            <a href="javascript:disabled('{$qz['name']}')" class="label label-primary radius">禁用</a>
                            <else/>
                            <a href="javascript:enabled('{$qz['name']}')" class="label label-primary radius">启用</a>
                        </if>
                        <a href="javascript:uninstall('{$qz['title']}','{$qz['name']}')" class="label label-primary radius">卸载</a>
                        <else/>
                        <a href="javascript:install('{$qz['name']}')" class="label label-primary radius">安装</a>
                    </if>
                    <if value="$qz.IndexAction">
                        <a href="{$qz.IndexAction}" target="_blank" class="label label-primary radius">前台</a>
                        <else/>
                        <span class="label label-default radius">前台</span>
                    </if>
                    <if value="$qz.help">
                        <a href="{$qz.help}" target="_blank" class="label label-primary radius">帮助</a>
                        <else/>
                        <span class="label label-default radius">帮助</span>
                    </if>
                </td>
            </tr>
        </list>
    </table>
</div>
<include file="__PUBLIC__/footer"/>
<script>
    //打包
    function package(name) {
        ajax_req("{|U:'package'}", {addon: name});
    }
    //启用
    function enabled(name) {
        ajax_req("{|U:'enabled'}", {addon: name});
    }
    //禁用
    function disabled(name) {
        ajax_req("{|U:'disabled'}", {addon: name});
    }
    //安装
    function install(name) {
        ajax_req("{|U:'install'}", {addon: name});
    }
    //卸载
    function uninstall(title, name) {
        ajax_req("{|U:'uninstall'}", {addon: name});
    }
</script>
</body>
</html>